package com.service.gmall.common.retey;

import feign.RetryableException;
import feign.Retryer;

/**
 * @author alpha
 * @className: MyRetry
 * @date 2022/9/5 19:43
 * @Description
 */
public class MyRetry implements Retryer {
    int cur = 0;
    int max = 2;
    public MyRetry(){
        cur = 0;
        max = 2;
    }
    @Override
    public void continueOrPropagate(RetryableException e) {
//        if (cur++ > max){
//            throw e;
//        }
        throw e;
    }

    @Override
    public Retryer clone() {
        return this;
    }
}
